Cache memory with dynamic lockstep support

ABSTRACT

Cache storage may be partitioned in a manner that dedicates a first portion of the cache to lockstep mode execution, while providing a second (or remaining) portion for non-lockstep execution mode(s). For example, in embodiments that employ cache storage organized as a set associative cache, partition may be achieved by reserving a subset of the ways in the cache for use when operating in lockstep mode. Some or all of the remaining ways are available for use when operating in non-lockstep execution mode(s). In some embodiments, a subset of the cache sets, rather than cache ways, may be reserved in a like manner, though for concreteness, much of the description that follows emphasizes way-partitioned embodiments.

CROSS-REFERENCE TO RELATED APPLICATION(S)

The present application is related to commonly-owned, co-pending U.S.patent application Ser. No. ______ {Docket No. NM45956HH}, filed on evendate herewith, entitled “DYNAMIC LOCKSTEP CACHE MEMORY REPLACEMENTLOGIC,” and naming William C. Moyer as inventor, the entirety of whichis incorporated herein by reference.

BACKGROUND

1. Field

The present invention relates to multiprocessor data processing systemsand, more particularly, to cache techniques that facilitatetransitioning between lockstep and non-lockstep modes of processoroperation.

2. Related Art

In some data processing applications, multiple processor instances areemployed to concurrently execute identical code sequences with identicaldata inputs. Typically, the processors execute in lockstep. Error logicmay then detect a difference in execution states of the processors and,based thereon, signal a transient or permanent error in one of theprocessor instances. For example, in automotive electronics systems,this form of redundancy can be used to achieve reliability thresholds ordesired safety integrity levels. Unfortunately, providing redundantprocessors can be expensive and, as a general proposition, not allaspects of a data processing application require such reliability orsafety integrity levels. As a result, non-critical aspects of a dataprocessing application may be burdened by lockstep execution overheadsand/or otherwise useful processing cycles may be squandered.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and not limitedby the accompanying figures, in which like references indicate similarelements, and in which:

FIG. 1 illustrates, in block diagrammatic form, a data processing systemin accordance with some embodiments of the present invention. FIG. 2illustrates, in block diagrammatic form, another data processing systemin accordance with some embodiments of the present invention.

FIG. 3 illustrates, in block diagrammatic form, one example of a cacheinstance such as illustrated in FIG. 1 or FIG. 2, the cache instanceincluding cache control logic adapted for dynamic lockstep support.

FIG. 4 illustrates, in diagrammatic form, portions of a cache controland status register that, in one example of the cache instance of FIG.3, programmably define allocation of ways to lockstep and performancemodes.

FIGS. 5 and 6, in turn, illustrate in tabular form, one example of fielddefinitions within the cache control and status register of FIG. 4.

FIG. 7 illustrates, in flow diagram form, lockstep mode hit/misshandling of an access request in one example of the cache instance ofFIG. 3.

FIG. 8 illustrates, in flow diagram form, performance mode hit/misshandling of an access request in one example of the cache instance ofFIG. 3.

FIG. 9 illustrates, in block diagrammatic form, one example of thereplacement logic and lockstep mode control of FIG. 3, wherein lockstepand performance mode versions of replacement pointer instances, stateand logic are provided.

FIG. 10 illustrates, in block diagrammatic form, another example ofreplacement logic and lockstep mode control of FIG. 3, wherein lockstepand performance mode versions of set-denominated replacement pointerinstances, state and logic are provided.

FIG. 11 illustrates, in flow diagram form, lockstep mode handling ofupdates to global and local replacement states by replacement logic suchas illustrated in FIG. 9 or FIG. 10.

FIG. 12 illustrates, in flow diagram form, performance mode handling ofupdates to global and local replacement states by replacement logic suchas illustrated in FIG. 9 or FIG. 10.

Persons of ordinary skill in the art will appreciate that elements inthe figures are illustrated for simplicity and clarity and have notnecessarily been drawn to scale. For example, the dimensions of some ofthe elements in the figures may be exaggerated relative to otherelements to help improve the understanding of the embodiments of thepresent invention.

DETAILED DESCRIPTION

Techniques are desired whereby a collection of processor instances in adata processing system may, at times operate in a lockstep executionmode, while at other times (and/or for certain portions of thecomputational load) support concurrent, non-lockstep, execution ofgenerally independent computational tasks. In this way, a dataprocessing application may benefit from the additional processing poweravailable in modern multiprocessor and multi-core processorimplementations, while allocating a portion of that processing power toredundancy, when and if needed.

Dynamic entry into, and exit from, lockstep modes of execution, whiledesirable, can present significant challenges, particularly when cachesare present in the data processing system. In particular, since lockstepoperation typically requires identical execution of multiple processorson a cycle-by-cycle basis (or at least with phased, cycle-to-cyclecorrespondence) differences in caching states are problematic. Forexample, a difference in contents of respective caches employed byrespective processors can result in one processor having a cache hit fora particular memory access in a code sequence, while another (or others)attempting to execute in lockstep take(s) a cache miss for the very samememory access. Maintaining identical caching states is complicated byinterleaved execution of differing non-lockstep computations on therespective processors and the fact that replacement algorithms operantat respective caches may evict different cache lines.

Conventional solutions tend to be crude, either disabling the cache forlockstep execution, or invalidating or simply flushing cache contents ata transition between execution modes. As will be appreciated,synchronization of caching states for two processors entering lockstepexecution can impose very high overhead, potentially adding thousands ofexecution cycles. What is needed are techniques that facilitate dynamic,low-overhead entry into (and in some cases exit from) processor lockstepexecution mode from/to independent, non-lockstep execution mode(s).

Lockstep Partition and Hit/Miss Handling

It has been discovered that cache storage may be partitioned in a mannerthat dedicates a first portion of the cache to lockstep mode execution,while providing a second (or remaining) portion for non-lockstepexecution mode(s). For example, in embodiments that employ cache storageorganized as a set associative cache, partition may be achieved byreserving a subset of the ways in the cache for use when operating inlockstep mode. Some or all of the remaining ways are available for usewhen operating in non-lockstep execution mode(s). In some embodiments, asubset of the cache sets, rather than cache ways, may be reserved in alike manner, though for concreteness, much of the description thatfollows emphasizes way-partitioned embodiments.

In many practical data processing applications, lockstep mode executionexploits multiple processor instances for redundancy to achievereliability or desired safety integrity levels, while non-lockstepexecution provides increased execution performance by making processorinstances available for execution of independent programs, processes orthreads. Accordingly, though without limitation, much of the descriptionherein focuses on exemplary embodiments and/or use scenarios in whichtransitions are between a safety-or redundancy-motivated lockstepexecution mode and a non-lockstep, performance mode. Nonetheless, basedon the description herein, persons of ordinary skill in the art willappreciate exploitations or adaptations of the inventive techniques incaching architectures that provide lockstep and non-lockstep modeswithout regard to safety or performance concerns.

Thus, focusing illustratively on way-partitioned embodiments, a firstsubset of the cache ways used in lockstep mode remain valid and are notflushed or invalidated when transitioning to performance mode, andvice-versa. Instead, these lockstep ways are locked or frozen and arenot available for replacement while the processor with which they areassociated executes in performance mode. In lockstep mode, these samelockstep ways are unlocked or unfrozen but, in accordance with theidentical code sequences that execute on the processors of a lockstepexecution set, identically track state of the lockstep ways in cachesassociated with the(se) other processor(s) of the lockstep executionset. Locking/unlocking is typically transparent to application softwareand may coincide with context switches between a process or thread whichrequires (or benefits from) lockstep mode execution on multipleprocessor instances and those that do not. Cache ways allocated toperformance mode remain valid while in lockstep mode, but do not satisfyload or store hits, and are not available for allocation.

One implication of the above is that memory access requests made in onemode (e.g., in correspondence with load and store operations executed bythe processors performance mode) may hit in a cache portion associatedwith the other mode. The cache operates in a writethrough mode andaccess requests are handled in a manner that maintains coherency betweenentries represented in respective portions of the cache, e.g., betweencorresponding cache line entries in lockstep and performance ways.

More specifically, cache hits to lockstep ways that result from loadoperations executed in performance mode are satisfied normally andreturn cache data to the processor. On the other hand, cache hits toperformance ways that result from load operations executed in lockstepmode are not allowed to satisfy the load operation, since theperformance ways in cache associated with the other processor (orprocessors) of the lockstep execution set may not contain the line.Instead, in one embodiment, such a hit causes the corresponding line inthe performance way to be invalidated. As a result, there is no problemwith multiple copies of the same address in multiple ways. Rather, hitsto performance ways that result from load operations executed inlockstep mode are treated by hit/miss logic as a miss (relative to thelockstep ways) and result in a cache line allocation and fill to a cacheline in a lockstep way.

Although write hits present challenges, the techniques described hereinaddress these challenges in innovative manners. Write hits that occur(during performance mode execution) to cache ways that have beenreserved for lockstep mode execution have two different behaviors, whichcan be programmatically selected by the user. A first selectablebehavior is to update the cache contents (i.e., the contents of thelockstep mode way) normally, as if no special operation is assumed,relying instead on software techniques to invalidate prior to anylockstep mode access. The second selectable behavior is to invalidatethe cache line on a write hit. These options are software selectable,e.g., by control register settings.

In many of the data processing applications for which dynamictransitions between lockstep and non-lockstep modes of execution wouldbe desirable, no write hits are expected, as data shared between aperformance mode portion of a data processing application and a lockstepportion is either minimal or non-existent. Even if data is sharedbetween execution modes, it can typically be marked cacheinhibited,thereby obviating coherence issues. Alternatively, such data can beinvalidated in the lockstep portion of the cache prior to access by thelockstep portion of the data processing application. Programmingconstructs and facilities for such invalidation are already common insystems that employing software-managed cache coherency, thus persons ofordinary skill in the art will appreciate exploitations of suchfacilities to effectuate the desired invalidation of a lockstep wayentry if the selected behavior allows the write hit to complete“normally” to either lockstep ways or performance ways, regardless ofexecution mode.

Optionally, performance mode write hits to ways allocated to lockstepmode can be configured to cause invalidation of the corresponding cacheline in the same processor. In systems that provide hardware coherencysupport, this option is attractive since the write data will also bewritten through into system memory, and the write through operation willgenerate a snoop cycle to the other processor(s) which is (are)temporarily running independently. This snoop cycle will then invalidatethe corresponding cache line in the other processor(s). As will beappreciated, the final state will be such that the line has been removedfrom the lockstep ways of each processor, and thus cache state remainsconsistent, assuring that future lockstep operation will not be affectedby inconsistent cache contents.

When executing in lockstep mode, write hits to ways allocated toperformance mode will update the performance mode cache line if no writeallocation is performed, and the write will be treated as aforced-writethrough. If write allocation is performed, then a write hitto a performance mode cache line will first cause an invalidation ofthat line. Following the invalidation, the line will be allocated in alockstep mode way. Snoop operations proceed normally in both modes, anddo not distinguish between performance mode and lockstep mode states orcache way allocations. Cache coherency is thus maintained, regardless ofwhich ways (if any) of the cache(s) of the other processor(s) containthe same cache line.

Replication of Replacement Pointer/States

It has further been discovered that to facilitate dynamic lockstepsupport, replacement states and/or logic used to select particular cachelines for replacement with new allocations in accord with replacementalgorithms or strategies may be enhanced to provide generallyindependent replacement contexts for use in respective lockstep andperformance modes. In some cases, replacement logic that may beotherwise conventional in its selection of cache lines for newallocations in accord with a first-in, first-out (FIFO), round-robin,random, least recently used (LRU), pseudo LRU, or other replacementalgorithm/strategy is at least partially replicated to provide lockstepand performance instances that respectively cover lockstep andperformance partitions of a cache. In some cases, a unified instance ofreplacement logic may be reinitialized with appropriate states at (orcoincident with) transitions between performance and lockstep modes ofoperation.

In either case, implementations of counters, pointers or otherreplacement logic or circuits state suitable for maintaining andadvancing a replacement state in correspondence with cache hit/misssequences are well understood in the art. Based on the descriptionherein, persons of ordinary skill in the art will appreciate suitableextensions to replicate such replacement logic/circuits and/or theinitialization of same in correspondence with transitions betweenperformance and lockstep modes of operation.

Persons of ordinary skill in the art will likewise appreciate that acache may implement replacement strategies that have both global andlocal aspects. For example, in a system that implements “way locking” tolock certain cache ways from being replaced, global replacement logicmay identify a cache way to be replaced that excludes the locked cacheway(s) and override any operant local replacement logic if the localreplacement logic pointed to a locked cache way. In some embodiments, anoperant instance of local replacement logic selects (subject to globalreplacement logic preemption or override) from amongst ways of anapplicable lockstep or performance partition. In some embodiments,preemption or override by global replacement logic may allow the cachecontrols to efficiently avoid interrogating or modifying numerous localreplacement state values for a global policy change like locking aparticular cache way.

While embodiments are described that implement both local and globalreplacement aspects consistent with a way-partitioned set associativecache example in which way locking is supported, it will be understoodthat some embodiments in accordance with the present invention need notimplement a global replacement state override. Likewise, in some cachedesigns (such as in embodiments where partitioning is by cache setsrather than by cache ways) replacement logic may not have local scopeper se. Accordingly, claim terminology that does not specify a local orglobal scope for replacement logic is intended to broadly encompasslogic that may have local scope, global scope or both local and globalscope.

In short, whether by replication or initialization, cache control logicdescribed herein duplicates the state of replacement logic forindependent use in lockstep and performance modes. The state ofreplacement logic used in lockstep mode is generally frozen duringperformance mode operation or, in some cases, reinitialized ontransition to lockstep mode. In cache control logic implementations thatdistinguish between local and global replacement states, performancemode load or store hits to entries in a lockstep partition do not affectlockstep mode replacement state (e.g., pseudo-LRU state in a lockstepmode instance of local replacement logic) for those entries or anyglobal replacement state used in lockstep mode, even though the load orstore access may be satisfied by the lockstep partition hit. Hits toperformance ways are not allowed to satisfy access requests while inlockstep mode. Accordingly, replacement state updates can optionally beperformed for performance mode replacement state (e.g., pseudo-LRU statein a performance mode instance of local replacement logic) if, duringlockstep mode operation, a cache line is invalidated in the performancepartition.

Embodiments in accord with the foregoing will be understood relative tothe description of example implementations and operations that follow.

Systems and Integrated Circuit Realizations, Generally

Referring to FIG. 1, in one embodiment, a data processing system 10includes a pair of integrated circuits 12, 13, a system memory 14 andone or more other system module(s) 16. The integrated circuits 12, 13,system memory 14 and the one or more other system module(s) 16 areillustratively connected via a multiple conductor system bus 18 althoughany of a variety of communication paths may be provided. Integratedcircuit 12 includes at least one processor 20, core or other form ofprogrammable execution unit that is connected to an associated localcache 22 via a multiple conductor internal bus 26. In some embodiments,local cache 22 is organized as a set associative cache. Also connectedto the internal bus 26 are other internal modules 24 and a bus interfaceunit 28. The bus interface unit 28 has a first multiple conductorinput/output terminal connected to the internal bus 26 and a secondmultiple conductor input/output terminal connected to the system bus 18.

Integrated circuit 13 is substantially similar in design to integratedcircuit 12 and likewise includes at least one processor 21 connected toan associated local cache 23 via a multiple conductor internal bus 27.Also connected to internal bus 27 are other internal modules 25 and abus interface unit 29 that connects to system bus 18.

It should be understood that data processing system 10 is exemplary andis presented in a way that tends to facilitate description of variousinventive techniques herein relative to an illustrative pair ofprocessors and associated local caches. Neither the multiplicity ofintegrated circuits, nor separation of processors 20, 21 (and associatedlocal caches 22, 23) on distinct internal busses 26, 27 are at allessential. Indeed, FIG. 2 illustrates a variation in which processors20, 21 (and associated local caches 22, 23) are interconnected usinginternal bus 26, all formed on a single integrated circuit. Moregenerally, larger numbers of processors and associated caches may beprovided. Processors may be implemented as one or more cores in amulti-core design. Caches may be more tightly integrated with portionsof an integrated circuit that implement the processors, cores orexecution units (generally “processors”) illustrated and describedherein, and other interconnect technologies (including crossbarnetworks, point-to-point communications, etc.) may be substituted forbus-type interconnects illustrated.

In view of the above, and without limitation, certain operationalaspects are now more completely described with reference to illustrativeFIGS. 1 and 2. In operation, processors of integrated circuits 12 and/or13 perform programmed data processing functions wherein respectiveprocessors 20, 21 execute instructions and utilize the other illustratedelements in the performance of the instructions. In accord withdescription elsewhere herein, processors 20, 21 of data processingsystem 10 may, at times operate in a lockstep execution mode, while atother times (and/or for certain portions of the computational load)support concurrent, non-lockstep, execution of generally independentcomputational tasks. For convenience of description and terminology,processors 20, 21 and their associated local caches 22, 23 are said totransition dynamically between lockstep and performance modes.

To provide the appearance of extremely fast addressable memory, cachingtechniques are employed, including in the illustrated configuration, useof local caches 22, 23 to each respectively maintain a subset of dataand/or instructions in accessed in the course of the aforementionedprogrammed data processing functions. If data and/or instructions beingread or written by processor 20, 21 are not available in a valid entryof an associated local cache, they may be retrieved from storage at ahigher level of cache (e.g., cache 15) or system memory 14. Tofacilitate the dynamic transitioning between lockstep and performancemodes, local caches 22, 23 are partitioned in a manner that dedicates afirst portion of the cache to lockstep mode execution, while providing asecond (or remaining) portion for non-lockstep execution mode(s). Forexample, local cache 22 may be organized as a set associative cache, andpartitioning may be achieved by reserving a subset of the ways in localcache 22 for use when processor 20 operates in lockstep mode. Likewisewith respect to local cache 23 and processor 21. Some or all of theremaining ways are available for use when operating in non-lockstepexecution mode(s). As previously explained, way-partition isillustrative and, in some embodiments, a subset of the cache sets,rather than cache ways, may be reserved in a like manner, though forconcreteness, much of the description that follows emphasizesway-partitioned embodiments.

CACHE STORAGE AND IMPLEMENTATION EXAMPLE

FIG. 3 depicts portions of one example of an N-way, set-associativecache instance such as illustrated in FIGS. 1 and 2 as cache 22 and/orcache 23. The illustrated cache instance includes cache control logicadapted for dynamic lockstep support in accordance with some embodimentsof the present invention. Cache 22, 23 includes a tag memory array formultiple ways 42, 44, 46 . . . 48, data memory array for multiple ways50, 52, 54 . . . 56, and cache control logic 58. In the illustratedportion of cache 22, 23, lockstep mode control 55 (which may beimplemented as one or more control registers of, or accessible to, cachecontrol logic 58) codes or otherwise identifies a current operating mode(e.g., lockstep or performance) together with a current way-denominatedpartition of the associated cache instance into lockstep ways 81 andperformance ways 82.

An access address 40 is received from an address portion of bus 26 or 27and has a tag value portion 64, an index portion 66, and a word selectportion 68. For example, for a read access, access address 40corresponds to the address of the requested information (e.g., data orinstructions). In the illustrated embodiment, access address 40, whenreceived, is stored within register 62. Tag portion 64 of access address40 includes tag value data that is provided to the multi-way tag array42, 44, 46 . . . 48. Data from the index portion 66 is provided to boththe multi-way tag array 42, 44, 46 . . . 48 and to the multi-way dataarray 50, 52, 54 . . . 56 and is used to provide an index into the tagand data arrays. For example, in one embodiment, index portion 66includes a set indicator to select one of a predetermined number of setswithin the tag and data portions of each way. Data from the word selectportion 68 is provided to the multi-way data array 50, 52, 54 . . . 56such that data within a data array, such as data array (way 0) 50, isindicated by both index portion 66 and word select portion 68. That is,index portion 66 may identify one entry of data array (way 0) 50, andword select 68 then identifies a portion of that entry. The multi-waydata array is also coupled to a bidirectional data portion of the bus26, 27 to receive and provide data.

Each portion of the tag array, such as tag array (way 0) 42 provides ahit signal (which is gated, validated or otherwise influenced byhit/miss logic 53 of cache control logic 58) indicating that a hit hasoccurred to a particular way of the cache, which is then used to selecta corresponding data array, such as data array (way 0) 50, based on acomparison between tag value 64 and data within the respective portionof multi-way tag array 42, 44, 46 . . . 48 located with respect to indexvalue 66. For example, in operation, tag portion 64 is compared with avalue retrieved from the tag array (way 0) 42 via index portion 66 toprovide hit signal 72 in accord with gating, validation or influence byhit/miss logic 53 consistent with dynamic lockstep hit/miss handlingdescribed herein.

In general (and again subject to gating, validation or influence byhit/miss logic 53), if the compared values result in a match, then hitsignal 72 is asserted to indicate a hit. Data array (way 0) 50 includesa plurality of data blocks and is addressed by both the index value 66and the word select value 68, and, in response to the hit, the addresseddata item is output from the data array (way 0) 50 to the data portionof bus 26, 27. If, however, the compared values do not result in amatch, then hit signal 72 is not asserted, indicating a miss in that wayof cache 22, 23. If there is no match between tag value 64 and any ofthe tags in multi-way tag array 42, 44, 46 . . . 48, then none of hitsignals 72, 74, 76 . . . 78 are asserted, indicating that access address40 resulted in a miss in cache 22, 23.

Cache control circuitry 58, whose operation will be described in moredetail below, is typically coupled to address, control and data portionsof bus 26, 27 and operates, in view of settings, status or configurationdata represented as lockstep mode control 55, to cause hit/miss logic 53to gate, validate or otherwise influence the supply of hit/missindications (e.g., hit signals 72, 74, 76 . . . 78) and to controloperation of replacement logic 51 in accord with behaviors desired for acurrent lockstep or performance operating mode. For example, dependingon particular settings, status or configuration data represented aslockstep mode control 55, different cache replacement states and/ormechanisms may be operant and different hit/miss handling may beselected. Although such replacement states/mechanisms and hit/misshandling ultimately affect invalidation and other controls 87 signals,write enable 89 signals, and hit signals 72, 74, 76 . . . 78 supplied tothe data and tag arrays of cache 22, 23, the utilization and/or effectof such signals is largely conventional and will be understood bypersons of ordinary skill in the art.

Note that FIG. 3 illustrates only one example of a portion of cache 22,23. In alternate embodiments, other registers, data and control path,and/or tag and data array configurations may be provided in any of avariety of conventional or unconventional manners to achieve basiccaching functionality. Building on the description herein, cache controllogic (such as illustrated in FIG. 3) may be adapted, in accordance withparticular cache lookup, replacement and/or partition facilitiesprovided in such alternative embodiments to allocate respectivepartitions to lockstep and performance modes, to specialize hit/misshandling in accord with operating mode and the partition in which hitsmay occur and to maintain replacement state for lockstep and performancemodes respectively. Accordingly, while FIG. 3 depicts portions of oneexample of a cache instance that, for purposes of dynamic lockstepsupport is way-partitioned in a N-way, set-associative manner, based onthe present description, persons of ordinary skill in the art appreciatesuitable adaptations for other cache organizations or partitions inwhich dynamic lockstep support may be provided. In view of theforegoing, and without limitation, examples of cache control logic andoperations are now detailed.

FIGS. 4, 5 and 6 illustrate fields of a lockstep partition register 57that, in one example of lockstep mode control 55, programmably definesboth (i) an allocation of cache ways to lockstep and performance modesof operation and (ii) invalidation behaviors in cache 22, 23. Forexample, in the context of FIG. 3, lockstep partition register 57defines the partition of available cache ways into lockstep ways 81 andperformance ways 82. Note that for simplicity of description andillustration, cache instances are explained in a context generallyconsistent with for use as an L1 data cache; however, more generally,the techniques described herein are applicable to both data cache andinstruction cache instances or portions of a different overall cachingscheme. Based on the data-cache-centric description herein, persons ofordinary skill in the art will appreciate application of the describedtechniques and structures to instruction cache instances and/or toportions of an address space in which instructions reside. Accordingly,in the example of FIGS. 4, 5 and 6, way partition of an instructioncache portion and a data cache portion of a caching facility areseparately programmable (e.g., using field IWAL for instruction cacheway allocation and field DWAL for data cache way allocation). FieldDINVLWH programmably defines data cache behavior for a write hit in alockstep way that occurs during performance mode operation.

Referring again to FIG. 3, in response to an access request from arequesting device, the address of the requested information is providedto cache 22, 23 as access address 40. If tag value 64 of access address40 results in a match within the tag arrays 42, 44, 46, and 48, then acache hit occurs; otherwise a cache miss occurs. Handling of such acache hit or miss depends generally on (i) the operating mode (e.g.,lockstep or performance) in which the hitting or missing access occurs,(ii) the type of access request (e.g., a read request or a writerequest), (iii) whether a hit, if applicable, is in a cache partition(e.g., in a cache way) allocated to performance mode, and in someimplementations (iv) programmable invalidation behavior. Morespecifically, operation of hit/miss logic 53 will be understood withrespect to the lockstep mode hit/missing handling flow diagram of FIG. 7and with respect to the performance mode hit/miss handling flow diagramof FIG. 8.

Replacement states (represented generally by replacement logic 51) areupdated in correspondence with hit/miss handling; however, the operantversion of replacement state (e.g., for miss-triggered allocation of acache line) and the particular updates performed depend upon (i) theoperating mode (e.g., lockstep or performance) in which the accessoccurs and, in the case of a hit, (ii) whether the hit is in a cachepartition (e.g., in a cache way) allocated to performance mode. Morespecifically, operation of replacement logic 51 will be understood withrespect to the lockstep mode, replacement state flow diagram of FIG. 11and with respect to the performance mode, replacement state flow diagramof FIG. 12. Generally, any of a variety of replacement algorithms orstrategies may be implemented including first-in, first-out (FIFO),round-robin, random, least recently used (LRU), pseudo LRU, etc. In someimplementations, replacement state and/or logic is simply replicated forlockstep or performance modes. In some implementations, logic and statethat support replacement behaviors need not be fully replicated butrather may be initialized in correspondence with transitions betweenlockstep and performance modes.

Hit/Miss Handling

FIG. 7 illustrates lockstep mode hit/miss handling of access requests inone example of the cache instance of FIG. 3. In contrast, FIG. 8illustrates performance mode hit/miss handling of access requests. Thus,depending on the current mode in which a processor (e.g., processor 20,21, recall FIGS. 1 and 2) operates, the handling (by hit/miss logic 53,recall FIG. 3) of a given read or write access request that hits ormisses in the associated cache (e.g., cache 22, 23) can be understoodwith reference to FIG. 7 or FIG. 8.

Turning first to FIG. 7, lockstep mode hit/miss handling provided byhit/miss logic 53 of a cache (e.g., cache 22, 23) may be provided usingany suitable logic or circuit in which appropriate data transfer,allocation and/or invalidation actions (see actions 721, 722, 723, 724and 725) are selected based on type of access request (see decision711), hit or miss (see decisions 712, 713) in the tag arrays 41, 44, 46. . . 48 (recall FIG. 3), and in the case of hits, the partition (e.g.,performance ways 82 or lockstep ways 81, per decision 714, 715) in whichthe requested access hits. More specifically, in the case of a lockstepmode read (or load) access, a hit in a cache line of a performance way(see decisions 712, 714 [yes, yes]) triggers invalidation of theperformance way cache line (722) after which a cache line is allocated(and filled) in a lockstep way (721) and thereafter or coincident withthe allocation/fill of the new cache line in the lockstep way, read datais returned to the requesting processor. If the lockstep mode read (orload) access hits a cache line of a lockstep way (see decisions 712, 714[yes, no]), the request is satisfied with read data returned to therequesting processor from the lockstep way. A lockstep mode read (orload) access that misses (see decision 712 [no]) triggers allocation andfill in a lockstep way (721) and thereafter, following or coincidentwith allocation and fill, read data is returned to the requestingprocessor.

Turning to the case of a lockstep mode write (or store) access, andassuming an operant write-allocate cache policy (see decision 716[yes]), a hit in a cache line of a performance way (see decisions 713,715 [yes, yes]) triggers invalidation of the performance way cache line(722) after which a cache line is allocated in lockstep way (725) andthereafter write data is stored in both the newly allocated cache lineof the lockstep way and main memory (e.g., memory 14, recall FIGS. 1 and2). If a write-through or write-back cache policy is operant, thelockstep mode write (or store) access hit in a performance way (seedecisions 713, 715, 716 [yes, yes, no]), cache control logic may forgoinvalidation of the performance way cache line and allocation of a newline in a lockstep way and, instead, simply store the write data to boththe performance way cache line that hit and main memory (see action726). Likewise, if the lockstep mode write (or store) access hits in alockstep way (see decisions 713, 715 [yes, no]), cache control logiccauses write data to be stored in both the lockstep way cache line thathit and main memory (see action 726). A lockstep mode write (or store)access that misses (see decision 713 [no]) simply stores write data tomain memory (see action 724).

Turning next to FIG. 8, performance mode hit/miss handling provided byhit/miss logic 53 of a cache (e.g., cache 22, 23) may be provided usingany suitable logic or circuit in which appropriate data transfer,allocation and/or invalidation actions (see actions 821, 822, 823, 824and 825) are selected based on type of access request (see decision811), hit or miss (see decisions 812, 813) in the tag arrays 41, 44, 46. . . 48 (recall FIG. 3), and in the case of write hits, the partition(e.g., performance ways 82 or lockstep ways 81) in which a requestedwrite access hits (see decision 814). In practice, logic or circuitimplementations of hit/miss logic 53 will typically encompass decisiontrees of both FIGS. 7 and 8 although, for ease of illustration,hit/missing handling is separately explained herein for lockstep andperformance modes.

Referring then to FIG. 8, in the case of a performance mode read (orload) access, a hit (see decision 812 [yes]) returns read data (822) tothe requesting processor regardless of the partition (e.g., performanceways 82 or lockstep ways 81) in which the read hits. A performance moderead (or load) access that misses (see decision 812 [no]) triggersallocation and fill in a performance way (821) and thereafter, followingor coincident with allocation and fill, read data is returned to therequesting processor.

Turning to the case of a performance mode write (or store) access,programmable invalidation behavior may be supported in a way thataccommodates coherence mechanisms (e.g., software or hardware basedmechanism) that may be provided or operant in a given implementation.For example, in accord with the example lockstep partition register 57described above (e.g., field DINVLWH, recall FIG. 6) and assuming a“data cache invalidate lockstep way on write-hit in performance mode”(DINVLWH=1) setting, a write hit in a cache line of a lockstep way (seedecisions 813, 814, 815 [yes, no, yes]) triggers invalidation of thelockstep way cache line (823) and write data is stored in main memory(e.g., memory 14, recall FIGS. 1 and 2). Snoop cycles generated in ahardware coherence scheme can be relied upon to remove correspondingcache lines from lockstep ways of other cache instances. Alternatively,for a performance mode write (or store) access hit in a lockstep way(see decisions 813, 814, 815 [yes, no, no]), cache control logic mayforgo invalidation of the lockstep way cache line and, instead, simplystore the write data to both the lockstep way cache line that hit andmain memory (see action 825). In this way, and given a softwarecoherence mode oriented selection (e.g., DINVLWH=0, recall FIG. 6),invalidation of the now updated lockstep mode way may deferred pendingtransition to lockstep operating mode. Likewise, if the performance modewrite (or store) access hit in a performance way (see decisions 813, 814[yes, yes]), cache control logic causes write data to be stored in boththe performance way cache line that hit and main memory (see action825). Software managed cache coherence techniques are well understood inthe art and, based on the description herein, persons of ordinary skillin the art will appreciate that performance mode write hits may, in thisway, be allowed to completed “normally,” that is without regard to thepartition in which they hit. A performance mode write (or store) accessthat misses (see decision 813 [no]) simply stores write data to mainmemory (see action 824).

Replacement States

FIG. 9 illustrates, in block diagrammatic form, one example of thereplacement logic and lockstep mode control of FIG. 3, wherein lockstepand performance mode versions of replacement pointer instances areprovided using replicated state and update logic. In particular, theillustrated portion of replacement logic 51 provides lockstep andperformance instances (921 and 922) of replacement pointers to select(in correspondence with a current lockstep or performance operating modeLS/PERF) an appropriate cache line into which a new allocation may befilled. Respective instances (911 and 912) of state/update logicmaintain state information useful to the selection. For example, in someembodiments, state/update logic instances 911, 912 determine respectiveoperating mode specific replacement pointers (921 and 922) based onparameterizations of a relevant hit/miss history and consistent with animplemented replacement algorithm.

More specifically, lockstep mode replacement pointer 921 is supplied(during lockstep mode operation) to select an entry (e.g., a cache linerepresented in one of the lockstep ways 81 of cache 22, 23, recall FIG.3) as an allocation target for a cache fill after lockstep mode miss.Likewise, a performance mode replacement pointer 922 is supplied (duringperformance mode operation) to select an entry (e.g., a cache linerepresented in one of the performance ways 82 of cache 22, 23, recallFIG. 3) as an allocation target for a cache fill after performance modemiss. Lockstep and performance mode instances 911 and 912 of state andupdate logic provide an appropriate allocation target based on thereplacement state associated with a current operating mode (e.g., basedon lockstep mode replacement pointer 921 or performance mode replacementpointer 922), wherein appropriate subsets of hit/miss traffic aresupplied to the respective state and update logic instances 911 and 912so as to advance replacement states in accord with an implementedreplacement algorithm or strategy.

In the example of FIG. 3, LS/PERF field 59 of lockstep mode control 55controls selection of the appropriate pointer instance (see multiplexer941) and, together with contents of lockstep partition register 57,informs the application of hit/miss traffic (represented by hit[0:N] andcorresponding address indications from bus 26, 27) to the respectiveinstances of state and update logic. Demultiplexer 942 steers hit/misstraffic to the appropriate state and update logic instance, whilecontents of lockstep partition register 57 encode a current partition ofthe cache into performance and lockstep ways. Although current operatingmode hit/miss traffic typically informs update of the correspondingstate and update logic (i.e., performance mode hit/miss traffic updatesperformance mode state and update logic 912, while lockstep modehit/miss traffic updates lockstep mode state and update logic 911), aswill be explained in greater detail relative to functional flows ofFIGS. 11 and 12, lockstep mode hits in performance ways may updateperformance state and update logic 912 in correspondence withinvalidations.

As previously described, hit/miss logic 53 (recall FIG. 3 and thefunctional flows illustrated by way of FIGS. 7 and 8) determines whethera hit from particular cache partition may be used to satisfy an accessrequest and triggers invalidations and/or new allocations. Thus,allocation decisions from hit/miss logic 53 are shown as a triggeringinput to the illustrated portion of replacement logic 51. As will beappreciated, replacement logic 51 and hit/miss logic 53 may beintegrated in some implementations and any separation of the two in thepresent description is primarily for purposes of descriptive simplicity.It will be further understood that, in some implementations replacementlogic 51 may be decomposed on a cache way basis such that theillustrated portion thereof may be at least partially replicated forrespective cache ways. The simplified illustration of FIG. 9 does notattempt illustrate cache way decompositions of replacement logic;however, FIG. 10 illustrates a cache set decomposition. Finally,although replacement strategies may (in some implementations) includeglobal and local aspects, for generality, the simplified illustration ofFIG. 9 does not attempt to functionally decompose logic into globaland/or local replacement state portions. Rather, persons of ordinaryskill in the art will appreciate possible functional decompositionsbased on description elsewhere herein and based on the description andflows of FIGS. 11 and 12.

As will be appreciated, lockstep mode state and update logic 911advances lockstep mode replacement pointer 921 in accord with lockstepmode hit/miss traffic and in accord with an implemented FIFO,round-robin, random, LRU, pseudo LRU, or other replacementalgorithm/strategy. Likewise, performance mode state and update logic912 advances performance mode replacement pointer 922 in accord withperformance mode hit/miss traffic and in accord with an implementedfirst-in, first-out (FIFO), round-robin, random, least recently used(LRU), pseudo LRU, or other replacement algorithm/strategy. In an effortto avoid obscuring the invented techniques, state and update logicinstances are illustrated as functional blocks and withoutparticularized implementation detail that might be associated with aparticular replacement algorithm or strategy. Nonetheless, persons ofordinary skill in the art will appreciate a variety of suitable logic orcircuit implementations of state and update logic for any givenreplacement algorithm or strategy.

FIG. 10 illustrates, in block diagrammatic form, another example ofreplacement logic and lockstep mode control of FIG. 3, wherein lockstepand performance mode versions of set-denominated replacement instancesof state, update logic and replacement pointers are provided. Structuresand operation of FIG. 10 will be understood as analogous to thosepreviously explained relative to FIG. 9 but with selection of theappropriate pointer instance (see multiplexer 1041) and steeringhit/miss traffic (see multiplexer 1042) in accord with address-based setselections 1043.

FIG. 11 illustrates lockstep mode maintenance of replacement states byreplacement logic such as illustrated in FIG. 9 or FIG. 10. In contrast,FIG. 12 illustrates performance mode maintenance of such replacementstates. In both cases, functional flows are explained relative toaddressable storage access requests (e.g., read requests and writerequests) initiated by a processor 20, 21 (recall FIGS. 1 and 2) andhandled by an associated cache (e.g., cache 22 or 23). For simplicity ofdescription and in an effort to focus on replacement state maintenance,cache hit and cache miss processing is not detailed in FIGS. 11 and 12.Rather, cache hit/miss handling during lockstep mode will understoodbased on the preceding description of FIGS. 7 and 8.

Turing first to FIG. 11, a lockstep mode flow for maintainingreplacement states in replacement logic 51 of cache 22, 23 (recall FIG.3) differentiates primarily between those accesses that hit in a cacheway associated with a lockstep partition (e.g., in lockstep ways 81,recall FIG. 3) and those accesses that hit in a cache way associatedwith a performance partition (e.g., in performance ways 82). Forexample, the lockstep mode copy of “local replacement state” for the hitset (or simply “replacement state” in embodiments in which no globalversus local distinction applies) is updated (1122) for each hit to alockstep way (see decisions 1111, 1112 [yes, no]). In contrast, for alockstep mode hit to a performance way (see decisions 1111, 1112 [yes,yes]), the performance mode copy of local replacement state for the hitset (or again simply “replacement state” in embodiments in which noglobal versus local distinction applies) is updated (1121) only ifhandling of a lockstep mode hit to a performance way triggersinvalidation of the performance way cache line (recall actions 722, 725in FIG. 7). Such updates to the performance mode replacement state mayindicate that the invalidated way is “least recently used” or in someother manner is a better candidate for replacement in an embodiment.Replacement state updates for a cache miss (see decision 1111 [no])include update (1123) of the lockstep mode copy of “local replacementstate” for the replacement set.

Although (i) replication of replacement logic and/or initialization atmode transitions and (ii) decision-making relative to current operatingmode (e.g., lockstep mode or performance mode) and partition in which agiven access request hits are unconventional, the nature of replacementstate updates performed in furtherance of a particular replacementalgorithm or strategy (e.g., FIFO, round-robin, random, LRU, pseudo-LRU,etc.) need not be. Rather, any of a variety of state, logic and/orcircuit formulations of a desired replacement algorithm or strategy maybe employed. Note that in embodiments that maintain global aspects ofreplacement state, global replacement state is updated in correspondencewith cache hits/misses without regard to current operating mode or, inthe case of cache hits, the particular cache partition (e.g., lockstepor performance way) in which an access hits. Note also, that in theexample of FIG. 7, no distinction between read-type (load) or write-type(store) accesses is necessary.

Turning finally to FIG. 12, a performance mode flow for maintainingreplacement states again differentiates primarily between those accessesthat hit in a cache way associated with a lockstep partition (e.g., inlockstep ways 81, recall FIG. 3) and those accesses that hit in a cacheway associated with a performance partition (e.g., in performance ways82). For example, the performance mode copy of “local replacement state”for the hit set (or simply “replacement state” in embodiments in whichno global versus local distinction applies) is updated (1221) for eachhit to a performance way (see decisions 1211, 1212 [yes, yes]). Incontrast, for a performance mode hit to a lockstep way (see decisions1211, 1212 [yes, no]), the lockstep mode copy of local replacement statefor the hit set (or again simply “replacement state” in embodiments inwhich no global versus local distinction applies) is not updated (1222).Rather, the lockstep mode copy of local replacement state (or“replacement state”) remains frozen in the state that it had upontransition from lockstep mode to performance mode. By maintaining thecurrent state of lockstep replacement state even when an access hit hasoccurred (in performance mode), a subsequent transition back to lockstepmode ensures that the replacement of a cache line in one processor willutilize the same replacement value as that in a different processor inwhich no performance mode cache hit occurred to the line. Replacementstate updates for a cache miss (see decision 1211 [no]) include update(1223) of the performance mode copy of “local replacement state” for thereplacement set.

As before, in contrast with (i) replication of replacement logic and/orinitialization at mode transitions and (ii) decision-making relative tothe current operating mode (e.g., lockstep mode or performance mode) andpartition in which a given access request hits, the nature or mechanismof replacement state updates performed in furtherance of a particularreplacement algorithm or strategy (e.g., FIFO, round-robin, random, LRU,pseudo-LRU, etc.) may be largely conventional. Indeed, any of a varietyof state, logic and/or circuit formulations of a desired replacementalgorithm or strategy may be employed. Also as before, in embodimentsthat maintain global aspects of replacement state, global replacementstate is updated in correspondence with cache hits/misses without regardto current operating mode or, in the case of cache hits, the particularcache partition (e.g., lockstep or performance way) in which an accesshits. Finally, as with lockstep mode maintenance of replacement states,no distinction between read-type (load) or write-type (store) accessesis necessary.

Other Embodiments

Although the invention is described herein with reference to specificembodiments, various modifications and changes can be made withoutdeparting from the scope of the present invention as set forth in theclaims below. For example, while techniques have been described in thecontext of particular processor and set associative cache architecturesand with safety/redundancy- and performance-oriented use cases forlockstep and non-lockstep modes, the described techniques have broadapplicability to designs in which multiple execution units are providedand in which a storage hierarchy seeks to tolerate low overhead dynamictransitions to and from a execution mode in which data is replicated.

Embodiments of the present invention may be implemented using any of avariety of different information processing systems. Of course,architectural descriptions herein have been simplified for purposes ofdiscussion and those skilled in the art will recognize that illustratedboundaries between logic blocks or components are merely illustrativeand that alternative embodiments may merge logic blocks or circuitelements and/or impose an alternate decomposition of functionality uponvarious logic blocks or circuit elements.

Articles, systems and apparati that implement the present invention are,for the most part, composed of electronic components, circuits and/orcode (e.g., software, firmware and/or microcode) known to those skilledin the art and functionally described herein. Accordingly, component,circuit and/or code details are explained at a level of detail necessaryfor clarity, for concreteness and to facilitate an understanding andappreciation of the underlying concepts of the present invention. Insome cases, a generalized description of features, structures,components or implementation techniques known in the art is used so asto avoid obfuscation or distraction from the teachings of the presentinvention.

Finally, the specification and figures are to be regarded in anillustrative rather than a restrictive sense, and consistent with thedescription herein, a broad range of variations, modifications andextensions are envisioned. Any benefits, advantages, or solutions toproblems that are described herein with regard to specific embodimentsare not intended to be construed as a critical, required, or essentialfeature or element of any or all the claims.

1. A method of operating a computational system that includes aplurality of processors each having an associated cache partitioned intolockstep and non-lockstep partitions, the method comprising: dynamicallytransitioning between a lockstep mode of operation and a non-lockstepmode of operation, wherein in the lockstep mode of operation, the pluralprocessors each execute a same code sequence in temporal correspondence,and wherein in the non-lockstep mode of operation, the plural processorsare capable of executing differing code sequences; in the non-lockstepmode, satisfying at least some load hits from the lockstep partition andat least some other load hits from the non-lockstep partition; and inthe lockstep mode, satisfying load hits only from the locksteppartition.
 2. The method of claim 1, further comprising: duringoperation of the computational system, partitioning the associatedcaches into lockstep and non-lockstep partitions.
 3. The method of claim1, further comprising: for a lockstep mode hit in the non-locksteppartition, invalidating the hit entry in the non-lockstep partition. 4.The method of claim 3, wherein for a lockstep mode load hit in thenon-lockstep partition, the invalidating is contemporaneous with accessrequest and triggers allocation and fill of a corresponding entry in thelockstep partition.
 5. The method of claim 3, wherein for a lockstepmode store hit in the non-lockstep partition, the invalidating iscontemporaneous with access request and triggers allocation and fill ofa corresponding entry in the lockstep partition.
 6. The method of claim3, further comprising: for a non-lockstep mode store hit in the locksteppartition, invalidating the hit entry in the lockstep partition.
 7. Themethod of claim 6, wherein for non-lockstep mode store hits in thelockstep partition, the invalidating is performed in accord with aprogrammable selection of invalidation behavior.
 8. The method of claim6, wherein for a non-lockstep mode store hit in the lockstep partition,the invalidating is contemporaneous with access request and triggers asnoop invalidation of a corresponding entry in another cache.
 9. Themethod of claim 6, wherein for a non-lockstep mode store hit in thelockstep partition, the store completes in the lockstep partition but issubsequently invalidated contemporaneous with transition from thenon-lockstep mode to the lockstep mode.
 10. The method of claim 1, inthe non-lockstep mode, freezing allocations to the lockstep partition;and in the lockstep mode, freezing allocations to the non-locksteppartition.
 11. The method of claim 1, wherein the partitioning is bycache ways, and further comprising: reserving a programmable number ofthe cache ways as the lockstep partition.
 12. The method of claim 1,wherein the partitioning is by cache sets.
 13. The method of claim 1,wherein, in the lockstep mode of operation, the temporal correspondenceprovides execution, on each of the plural processors, of same respectiveinstructions of the same code sequence in execution cycles that areeither identical or exhibit a generally fixed phase relationship.
 14. Anapparatus comprising: plural processors dynamically transitionablebetween lockstep and non-lockstep modes of operation, wherein in thelockstep mode of operation, the plural processors each execute a samecode sequence in temporal correspondence, and wherein in thenon-lockstep mode of operation, the plural processors are capable ofexecuting differing code sequences; and respective caches coupled to,and associated with, respective ones of the plural processors, therespective caches each including control logic operable to, in thenon-lockstep mode, satisfy at least some load hits from a locksteppartition thereof and at least some other load hits from a non-locksteppartition thereof, and to, in the lockstep mode, satisfy load hits onlyfrom the lockstep partition but, for a hit in the non-locksteppartition, invalidate the hit entry in the non-lockstep partition. 15.The apparatus of claim 14, wherein the control logic is further operableto, in the lockstep mode, freeze allocations to entries of thenon-lockstep partition and, in the non-lockstep mode, freeze allocationsto entries of the lockstep partition.
 16. The apparatus of claim 14,further comprising: a control register coupled to the control logic, thecontrol register defining a changeable boundary between the lockstep andnon-lockstep partition portions of the caches.
 17. The apparatus ofclaim 14, further comprising: a control register coupled to the controllogic, the control register defining a selectable invalidation behaviorfor non-lockstep mode, write hits in the lockstep partition.
 18. Theapparatus of claim 14, wherein partition of the respective caches intothe lockstep and non-lockstep partitions is by cache ways.
 19. Theapparatus of claim 18, wherein partition of the respective caches intothe lockstep and non-lockstep partitions is by cache sets.
 20. Anintegrated circuit comprising: a processor capable of dynamictransitions between lockstep and non-lockstep modes of operation; acache associated with the processor and having control logic operable todefine a changeable boundary between a lockstep partition andnon-lockstep partition of the cache; and control logic responsive to acurrent mode indication and operable to, in the lockstep mode, freezeallocations to entries of the non-lockstep partition and, in thenon-lockstep mode, freeze allocations to entries of the locksteppartition.
 21. The apparatus of claim 20, further comprising: a controlregister coupled to the control logic, the control register to define aselectable invalidation behavior for non-lockstep mode, write hits inthe lockstep partition.